import React from 'react';
import { Pagination } from 'antd';
import Pts from 'prop-types';
// 我的分页组件
const Mypagniation = (props) => {

    // 切换页数和每页多少条数据的时候触发
    const onChange = (page, pageSize) => {
        // console.log(page, pageSize);
        props.setPage(page)
    }
    return (
        <div>
            <Pagination defaultCurrent={props.page} current={props.page} total={props.total} onChange={(page, pageSize) => onChange(page, pageSize)} />
        </div>
    );
}

Mypagniation.defaultProps = {
    page: 1,
}

Mypagniation.propTypes = {
    page: Pts.number.isRequired,
    total: Pts.number.isRequired
}

export default Mypagniation;
